package cn.stylefeng.guns.modular.business.frequency.transportreserverecord.controller;

import cn.stylefeng.guns.core.annotion.BusinessLog;
import cn.stylefeng.guns.core.enums.LogAnnotionOpTypeEnum;
import cn.stylefeng.guns.core.pojo.response.ResponseData;
import cn.stylefeng.guns.core.pojo.response.SuccessResponseData;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import cn.stylefeng.guns.modular.business.frequency.transportreserverecord.service.TransportReserveRecordService;
import cn.stylefeng.guns.modular.business.frequency.transportreserverecord.model.param.TransportReserveRecordParam;

import javax.annotation.Resource;

/**
 * 运单签收是否装车记录表 控制器
 *
 * @author: yujie
 * @date: 2023/05/09 17:15
 */
@RestController
public class TransportReserveRecordController {

    @Resource
    private TransportReserveRecordService transportReserveRecordService;

    /**
     * 分页查询运单签收是否装车记录表
     *
     * @author yujie
     * @date 2023/05/09 17:15
     */
    @GetMapping("/transportReserveRecord/page")
    @BusinessLog(title = "运单签收是否装车记录表_分页查询", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData page(TransportReserveRecordParam transportReserveRecordParam) {
        return new SuccessResponseData(transportReserveRecordService.page(transportReserveRecordParam));
    }

    /**
     * 获取全部运单签收是否装车记录表
     *
     * @author yujie
     * @date 2023/05/09 17:15
     */
    @GetMapping("/transportReserveRecord/list")
    @BusinessLog(title = "运单签收是否装车记录表_查询所有", opType = LogAnnotionOpTypeEnum.QUERY)
    public ResponseData list(TransportReserveRecordParam transportReserveRecordParam) {
        return new SuccessResponseData(transportReserveRecordService.list(transportReserveRecordParam));
    }

    /**
     * 查看详情运单签收是否装车记录表
     *
     * @author yujie
     * @date 2023/05/09 17:15
     */
    @GetMapping("/transportReserveRecord/detail")
    @BusinessLog(title = "运单签收是否装车记录表_查看详情", opType = LogAnnotionOpTypeEnum.DETAIL)
    public ResponseData detail(@Validated(TransportReserveRecordParam.detail.class) TransportReserveRecordParam transportReserveRecordParam) {
        return new SuccessResponseData(transportReserveRecordService.detail(transportReserveRecordParam));
    }

    /**
     * 添加运单签收是否装车记录表
     *
     * @author yujie
     * @date 2023/05/09 17:15
     */
    @PostMapping("/transportReserveRecord/add")
    @BusinessLog(title = "运单签收是否装车记录表_增加", opType = LogAnnotionOpTypeEnum.ADD)
    public ResponseData add(@RequestBody @Validated(TransportReserveRecordParam.add.class) TransportReserveRecordParam transportReserveRecordParam) {
        transportReserveRecordService.add(transportReserveRecordParam);
        return new SuccessResponseData();
    }

    /**
     * 删除运单签收是否装车记录表
     *
     * @author yujie
     * @date 2023/05/09 17:15
     */
    @PostMapping("/transportReserveRecord/delete")
    @BusinessLog(title = "运单签收是否装车记录表_删除", opType = LogAnnotionOpTypeEnum.DELETE)
    public ResponseData delete(@RequestBody @Validated(TransportReserveRecordParam.delete.class) TransportReserveRecordParam transportReserveRecordParam) {
        transportReserveRecordService.delete(transportReserveRecordParam);
        return new SuccessResponseData();
    }

    /**
     * 编辑运单签收是否装车记录表
     *
     * @author yujie
     * @date 2023/05/09 17:15
     */
    @PostMapping("/transportReserveRecord/edit")
    @BusinessLog(title = "运单签收是否装车记录表_编辑", opType = LogAnnotionOpTypeEnum.EDIT)
    public ResponseData edit(@RequestBody @Validated(TransportReserveRecordParam.edit.class) TransportReserveRecordParam transportReserveRecordParam) {
        transportReserveRecordService.edit(transportReserveRecordParam);
        return new SuccessResponseData();
    }


}
